package com.clhbolg.config;

import com.clhbolg.service.IResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @Author cailinhu
 * @Description TODO
 * @Date 2023/2/16 11:44
 * @Version 1.0
 */
@Configuration
@EnableScheduling
public class ScheduledConfig {

    @Autowired
    IResourceService resourceService;

    /**
     * 每天晚上12点执行导入接口到数据库
     */
    @Scheduled(cron = "0 0 0 * * ?")
    public void importSwagger(){
        resourceService.importSwagger();
    }
}
